import request from '@/utils/request'

export function selectPage(data){
    //http://h28439f5.natappfree.cc//appointmentRecord/addOrUpdateAppointmentByRespondent
    return request({
        url : `/firstaid-platform/userCenter/appointmentRecord/selectPageWithStaff`,
        method:"post",
        data
    })
}

/**
 * 加载预约单的签到记录
 * @param {*} data 
 * @returns 
 */
export function loadSignRecord(data){
    return request({
        url : `/firstaid-platform/userCenter/appointmentRecord/selectById`,
        method:"post",
        data
    })
}

export function saveAppointmentByLink(data){
    return request({
        url : `/firstaid-platform/userCenter/appointmentRecord/saveAppointmentByLink`,
        method:"post",
        data
    })
}

export function createAppointment(data){
    return request({
        url : `/firstaid-platform/userCenter/appointmentRecord/addOrUpdateAppointmentByRespondent`,
        method:"post",
        data
    })
}
/**
 * 签到
 * @param {*} data 
 * @returns 
 */
export function signUp(data){
    return request({
        url : `/firstaid-platform/userCenter/appointmentRecord/signInSite`,
        method:"post",
        data:{...data,type : "1"}    
    })
}

/**
 * 签退
 * @param {*} data 
 * @returns 
 */
export function signOut(data){
    return request({
        url : `/firstaid-platform/userCenter/appointmentRecord/signInSite`,
        method:"post",
        data:{...data,type:"2"}
    })
}